# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(OpenSceneGraph)

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)

add_library(OpenSceneGraph SHARED napi_osg.cpp osg_wrapper.cpp)
target_link_libraries(OpenSceneGraph PUBLIC libace_napi.z.so)
target_link_libraries(OpenSceneGraph PUBLIC libhilog_ndk.z.so)

#将三方库的头文件加入工程中
target_include_directories(OpenSceneGraph PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cJSON/${OHOS_ARCH}/include)
#将三方库加入工程中
target_link_libraries(OpenSceneGraph PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cJSON/${OHOS_ARCH}/lib/libosg.so.3.6.5
    ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cJSON/${OHOS_ARCH}/lib/libosgViewer.so.3.6.5
    ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cJSON/${OHOS_ARCH}/lib/libOpenThreads.so.3.6.5)